package com.longrise.co.ui.home.contract;

import com.longrise.LEAP.Base.Objects.EntityBean;
import com.longrise.co.ui.carlife.model.NewsBean;
import com.longrise.co.ui.home.model.AreaIdBean;
import com.longrise.co.ui.home.model.BindCarInfo;
import com.longrise.co.ui.home.model.CarCompany;
import com.longrise.co.ui.home.model.CityInfoBean;
import com.longrise.co.ui.home.model.CompanyDetail;
import com.ly.common.base.BaseModel;
import com.ly.common.base.BasePresenter;
import com.ly.common.base.BaseView;

import java.io.InputStream;
import java.util.List;

import rx.Observable;

/**
 * Created by luoyang on 2017-6-22.
 */

public interface HomeContract {

     interface View<T> extends BaseView {
        void requestSuccess(T t);
        void onRequestComplete(int type);

    }

    interface HomeView<T> extends View<T> {
        void backBindCarList(BindCarInfo bean);
        void backHomeNewsList(NewsBean bean);
        void backAreaId(AreaIdBean bean);
    }



     interface Model extends BaseModel {

        Observable<CarCompany> carCompanyRequest(EntityBean bean);
        Observable<BindCarInfo> bindCarListRequest(EntityBean bean);
         Observable<CompanyDetail> companyDetailRequest(EntityBean bean);
         //首页头条
         Observable<NewsBean> getHomeNewsRequest(EntityBean bean);

         Observable<CarCompany> nearByCompanyRequest(EntityBean bean);
         Observable<AreaIdBean> cityAreaIdRequest(EntityBean bean);
    }

     abstract class Presenter extends BasePresenter<View , Model> {
         public abstract void getCarCompany(int pageNum, int pageSize, String orgName, String level, String sortFlag, boolean isShowProcess);
         public abstract void getBindCarList(String carNo);
         public abstract void getCompanyDetail(String companyId, String areaId);

         public abstract void getHomeNewsList(int pageNum,int pageSize, boolean isShowProcess);

         public abstract void getNearByCompanyList(EntityBean bean, boolean isShowProcess);

         public abstract void getCityAreaId(String city, boolean isShowProcess);
    }

//    解析XML文件中的地址信息
     interface IXmlParser {
        public List<CityInfoBean> parse(InputStream is) throws Exception;
    }
}
